{include file=header.html}
 <script type="text/javascript" language="javascript" src="{lib file=jquery-1.6.3.min.js}"></script>
<script language="javascript" type="text/javascript" src="{lib file=jquery.ui/jquery.ui.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=DatePicker/WdatePicker.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=js/fabric_info.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=js/jquery.funkyUI.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=js/common.js}"></script>
<script language="javascript" type="text/javascript" src="{lib file=jquery.plugins/jquery.validate_1.11.0.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=js/select.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=js/auto_textarea.js}"></script>
<style type="text/css">
.btn-2{margin-bottom:5px;}
.table_no_border,.table_no_border td,.table_no_border th{
	padding:0;
	margin:0;
	border-width:0 1px 0 0;
	}
.fabric_info_list td input,.fabric_info_list td select{width:93%;}
.fabric_info_table td,.fabric_info_table th{
	border-left:none;
	border-bottom:none;
	}
.fabric_info_table th
{
   border-top:none;
}
.tab-display .no_right_border
{
	border-right:none;
}
.fabric_info_table .btn-2{
	line-height:20px;
	height:20px;
	margin-bottom:1px;}
#sample_filesize {width:100px;word-wrap: break-word;word-break: normal;word-break:break-all;}
</style>
<script type="text/javascript">
$(function() {
	 $('#sample_form').validate({
        onkeyup : false,
		onfocusout : false,
        rules : {
			/* brand_id: {
				min: 1
			}, */
			buyer_id: {
				required: true,
				min: 1
			},
			merchandiser_id: {
				min: 1
			}
        },
        messages : {
			/* brand_id: {
				min: '{$lang.brand_select_pls}'
			}, */
			buyer_id: {
				required: '{$lang.buyer_select_pls}',
				min: '{$lang.buyer_select_pls}'
			},
			merchandiser_id: {
				min: '{$lang.merch_select_pls}'
			}
        }
    });
	
		$('select[select_input="select_input"]').each(function(i) {
			init_select_input($(this));
		});
		$('div.select-input').each(function(i) {
			$(this).css('z-index', $('div.select-input').length - i);
		});
	});
	
	function delete_sample(){
		var s_id="{$sample.sample_id}";
		if(!s_id){
			alert("没有该样板");
			return false;
		}
		if(confirm('您确定要删除该样板吗？')==true){
			location.href="index.php?app=sample&act=delete&id="+s_id;
		}else{
			return false;
		}
	}
	
	</script>
<body>
<div id="fabric_shop_data" style="display:none;"><select><!--{foreach from=$fabricshop_list item=fabric_shop}--><option value="{$fabric_shop.fabric_shop_id}">{$fabric_shop.fabric_shop_name|escape}</option><!--{/foreach}--></select></div>
<div class="sub-body">
      
  <div class="tab-frame" style="width:900px;">
  <h3 class="tab-title-1">
  	<span>{$lang.sample_more_info}</span>
  </h3>
		<form method="post" id="sample_form">
    <table width="100%" cellspacing="0" cellpadding="0" class="tab-display">
      <tr>
        <th align="right">{$lang.sample_sn}：</th>
        <td class="tab-align-l">
        	<!-- {if $sample_handle} -->
        	{$sample.sample_sn|escape}
        	<!-- {/if} -->
          </td>
          <th colspan="4">{$lang.front_pic}</th>
		<th colspan="4">{$lang.other_pic}</th>
      </tr>
      <tr>
        <th align="right">{$lang.ref_sample_sn}：</th>
        <td class="tab-align-l">
        	<!-- {if $sample_handle} -->
        	{$sample.ref_sample_sn|escape}
        	<!-- {else} -->
        	<input name="sample_sn" value="{$sample.sample_sn|escape}" type="hidden">
        	{$sample.sample_sn|escape}
        	<!-- {/if} -->
          </td>
          <td colspan="4" rowspan="6"><img src="{$sample.front_pic}" id="front_pic_show"  width="220" height="190" /><input type="hidden" name="front_pic" id="front_pic" value="<!-- {if $smarty.get.act=='view_sample'} -->{$sample.front_pic}<!-- {/if} -->" onChange="document.getElementById('front_pic_show').src=this.value;" />
        <input type="hidden" name="front_pic_small" id="front_pic_small" value="" /></td>
		<td colspan="4" rowspan="6"><img src="{$sample.other_pic}" id="other_pic_show"  width="220" height="190" /><input type="hidden" name="other_pic" id="other_pic" value="<!-- {if $smarty.get.act=='view_sample'} -->{$sample.other_pic}<!-- {/if} -->" onChange="document.getElementById('other_pic_show').src=this.value;" /></td>
      </tr>
      <tr>
        <th align="right">{$lang.brand_name}：</th>
        <td class="tab-align-l">
           <select  style="width:150px;" name="brand_id" id="brand_id" onChange="brand_change(this.value);" <!-- {if $sample_handle} --><!-- {if $sample.status!=0} -->disabled<!-- {/if} --><!-- {/if} -->>
            <!--{foreach from=$brands item=brand key=k}-->
            <option {if $brand.brand_id eq $sample.brand_id}selected{/if} value="{$brand.brand_id}">{$brand.brand_name}&nbsp;&nbsp;({$brand.company_name|escape})</option>
            <!--{/foreach}-->
          </select>
          </td>
      </tr>

      <tr>
        <th align="right">{$lang.consumer}：</th>
        <td class="tab-align-l">
          <select style="width:150px;" name="buyer_id" id="buyer_id" onChange="buyer_change(this.value);" <!-- {if $sample_handle} --><!-- {if $sample.status!=0} -->disabled<!-- {/if} --><!-- {/if} -->>
            <!--{foreach from=$buyer_list item=buyer}-->
            <option {if $buyer.user_id eq $sample.buyer_id}selected{/if}  value="{$buyer.user_id}">{$buyer.user_name}</option>
            <!--{/foreach}-->
          </select>
          </td>
      </tr>
   
      <tr>
        <th align="right">{$lang.merchandiser}：</th>
        <td class="tab-align-l">        
          <select style="width:150px;" name="merchandiser_id" id="merchandiser_id" <!-- {if $sample_handle} --><!-- {if $sample.status!=0} -->disabled<!-- {/if} --><!-- {/if} -->>
            <!--{foreach from=$merchandiser_list item=merchandiser}-->
            <option {if $merchandiser.user_id eq $sample.merchandiser_id}selected{/if} value="{$merchandiser.user_id}">{$merchandiser.user_name}</option>
            <!--{/foreach}-->
          </select>
          </td>
      </tr>
      <tr>
        <th align="right">{$lang.style_name}：</th>
        <td class="tab-align-l">
           <select name="style_id" style="width:150px;" class="chzn-select" <!-- {if $sample_handle} --><!-- {if $sample.status!=0} -->disabled<!-- {/if} --><!-- {/if} -->>
            <option value="0">{$lang.select_pls}</option>
			<!--{foreach from=$style_list item=style}-->
            <option value="{$style.style_id}" {if $sample.style_id == $style.style_id}selected{/if}>{$style.style_name|escape}</option>
			<!--{/foreach}-->
          </select>
         </td>
      </tr>
      <tr>
        <th align="right">{$lang.order_sn}：</th>
        <td class="tab-align-l">
        	<input name="order_sn" id="order_sn" type="text" value="{$sample.order_sn|escape}" <!-- {if $sample_handle} --><!-- {if $sample.status!=0} -->readonly<!-- {/if} --><!-- {/if} --> />
        </td>
       
      </tr>
      <tr>
          <th align="right">{$lang.send_sample_date}：</th>
        <td class="tab-align-l">
        <!-- {if $sample.send_sample_date} -->{$sample.send_sample_date|date:Y-m-d}<!-- {/if} -->
       </td>
        <td colspan="8">
        	<!-- {if !$sample.is_preset && $sample.status==0} -->
        		<input type="button" id="upload_pics" class="btn-3" value="{$lang.update_pics}" onClick="block({$sample.sample_id})"/>
        	<!-- {/if} -->
        </td>
      </tr>
      <tr>
      	<th align="right">{$lang.sample_consumer_price}：</th>
      	<td class="tab-align-l"><input value="{$sample.consumer_price}" type="text" name="consumer_price" readonly="readonly"/></td>
      	<!-- {if $sample_handle} -->
      	<th align="right">{$lang.recomm_color}：</th>
      	<td colspan="7" align="left"><a href="{url app=colorcard&act=recomm_view&sample_id=$sample.sample_id}">查看</a></td>
     	<!-- {else} -->
     	<td colspan="8"></td>
     	<!-- {/if} -->
      </tr>
      <!-- {if $user.role==USER_MERCHANDISER} -->
      <tr>
      	<th align="right">细节图：</th>
      	<td colspan="9" align="left" id="sample_thumb_img">
      		<!-- {if $sample_handle} -->
        	<!-- {if $sample.status==0} -->
       		<input type="button" class="btn-3" value="{$lang.upload_enclosure}" onClick="upload_docs({$belongs_sample_thumb}, {if $sample_handle}{$sample.sample_id}{else}{$belongs_default_customer}{/if});" /><br />
        	<!-- {/if} -->
	        <!-- {else} -->
	        <input type="button" class="btn-3" value="{$lang.upload_enclosure}" onClick="upload_docs({$belongs_sample_thumb}, {if $sample_handle}{$sample.sample_id}{else}{$belongs_default_customer}{/if});" /><br />
	        <!-- {/if} -->
	        <!--{foreach from=$sample.consumer_sample_thumb item=file}-->
			<span><a href="download.php?id={$file.file_id}" style="color:blue">{$file.file_name}</a>
	        <!-- {if $sample_handle} -->
	        	<!-- {if $sample.status==0} -->
	        	<a class="pic_del" style="color:blue"  href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('{$lang.confirm_del_file}')" title="{$lang.delete}">&nbsp;</a>
	        	<!-- {/if} -->
	        <!-- {else} -->
	        <a class="pic_del" style="color:blue"  href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('{$lang.confirm_del_file}')" title="{$lang.delete}">&nbsp;</a>
	        <!-- {/if} -->
	        &nbsp;&nbsp;<!--{if !$smarty.foreach.last}--></span><!--{/if}-->
			<!--{/foreach}-->
      	</td>
      </tr>
      <!-- {/if} -->
      <tr>
        <th rowspan="2" align="right">{$lang.customer_reviews}：</th>
      	<td colspan="9" align="left">
       
        <textarea style="width:99%; height:50px;" id="customer_reviews" name="customer_reviews" <!-- {if $sample_handle} --><!-- {if $sample.status!=0} -->readonly<!-- {/if} --><!-- {/if} -->>{$sample.customer_reviews|escape}</textarea>
 </td></tr>
 
 <tr>
 <td colspan="9" id="sample_consumer_reviews" align="left"> 
       	<!-- {if $sample_handle} -->
        	<!-- {if $sample.status==0} -->
       		<input type="button" class="btn-3" value="{$lang.upload_enclosure}" onClick="upload_docs({$belongs_consumer_reviews}, {if $sample_handle}{$sample.sample_id}{else}{$belongs_default_customer}{/if});" /><br />
        	<!-- {/if} -->
        <!-- {else} -->
        <input type="button" class="btn-3" value="{$lang.upload_enclosure}" onClick="upload_docs({$belongs_consumer_reviews}, {if $sample_handle}{$sample.sample_id}{else}{$belongs_default_customer}{/if});" /><br />
        <!-- {/if} -->
        <!--{foreach from=$sample.customer_reviews_upload item=file}-->
		<span><a href="download.php?id={$file.file_id}" style="color:blue">{$file.file_name}</a>
        <!-- {if $sample_handle} -->
        	<!-- {if $sample.status==0} -->
        	<a class="pic_del" style="color:blue"  href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('{$lang.confirm_del_file}')" title="{$lang.delete}">&nbsp;</a>
        	<!-- {/if} -->
        <!-- {else} -->
        <a class="pic_del" style="color:blue"  href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('{$lang.confirm_del_file}')" title="{$lang.delete}">&nbsp;</a>
        <!-- {/if} -->
        &nbsp;&nbsp;<!--{if !$smarty.foreach.last}--></span><!--{/if}-->
		<!--{/foreach}--></td>
 </tr>

      <tr>
		<th colspan="1" rowspan="2" align="right" >备注：</th>
        <td colspan="9" align="left" >
        <textarea name="consumer_remark" id="consumer_remark" style="height:50px; width:99%;" <!-- {if $sample_handle} --><!-- {if $sample.status!=0} -->readonly<!-- {/if} --><!-- {/if} -->>{$sample.consumer_remark}</textarea>
    </td>
       
      </tr>
      <tr> <td colspan="9" id="sample_consumer_remark" align="left">     
        <!-- {if $sample_handle} -->
        	<!-- {if $sample.status==0} -->
        	<input type="button" class="btn-3" value="{$lang.upload_enclosure}" onClick="upload_docs({$belongs_consumer_remark}, {if $sample_handle}{$sample.sample_id}{else}{$belongs_default_customer}{/if});" /><br />
        	<!-- {/if} -->
        <!-- {else} -->
        <input type="button" class="btn-3" value="{$lang.upload_enclosure}" onClick="upload_docs({$belongs_consumer_remark}, {if $sample_handle}{$sample.sample_id}{else}{$belongs_default_customer}{/if});" /><br />
        <!-- {/if} -->
        <!--{foreach from=$sample.consumer_remark_upload item=file}-->
		<span><a href="download.php?id={$file.file_id}">{$file.file_name}</a>
		<!-- {if $sample_handle} -->
        	<!-- {if $sample.status==0} -->
		<a class="pic_del" href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('{$lang.confirm_del_file}')" title="{$lang.delete}">&nbsp;</a>
			<!-- {/if} -->
		<!-- {else} -->
		<a class="pic_del" href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('{$lang.confirm_del_file}')" title="{$lang.delete}">&nbsp;</a>
        <!-- {/if} -->
		&nbsp;&nbsp;<!--{if !$smarty.foreach.last}--></span><!--{/if}-->
		<!--{/foreach}-->
        
		</td></tr>
      <tr>
        <th colspan="1" align="right" style="font-size:12px;">{$lang.fabric_info}：</th>
       <td colspan="9" style="margin:0; padding:0;">
       <table width="100%" class="fabric_info_table" cellpadding="0" cellspacing="0">
       <th width="15%" class="no_left_border">面料描述</th>
       <th width="25%">{$lang.fabric_shop_name}</th>
       <th width="15%">品名/货号</th>
       <th width="10%">色卡</th>
       <!-- {if $sample_handle} -->
      <!--{foreach from=$fabric_info_list item=fabric_info name=fi}-->
       <tr class="fabric_info_list" style="text-align: center;">
       <td>
       <input name="fabric_info_id[]" type="hidden" value="{$fabric_info.fabric_info_id}" />
           <input name="cc_id[]" item="cc_id" type="hidden" value="{$fabric_info.cc_id}" />
       <input name="description[]" item="description" type="hidden"  value="{$fabric_info.description|escape}" />{$fabric_info.description|escape}</td>
       <td>
       <input name="fabric_shop_name[]" item="fabric_shop_name" type="hidden"  value="{$fabric_info.fabric_shop_id}" />
{$fabric_info.fabric_shop_name}</td>  
		<td>
       <input name="item[]" item="item" type="hidden"  value="{$fabric_info.item}" />
{$fabric_info.item}</td>   
       <td>
      <a  item="picture_show" cid="{$fabric_info.cc_id}"  href="javascript:;">查看</a>
</td>

       </tr>
       <!-- {foreachelse} -->
       <tr style="text-align: center;">
  			<td height="30" colspan="4">&nbsp;</td>
  		</tr>
       <!--{/foreach}-->
  		<!-- {else} -->
  		<tr style="text-align: center;">
  			<td height="30" colspan="4">&nbsp;</td>
  		</tr>
  		<!-- {/if} -->
       </table>
       
       </td>
      </tr>
    </table>
    <div style="text-align: center;margin: 10px;">
	  	<!-- {if $sample_handle} -->
        	<!-- {if $sample.status==0} -->
	  	<span><input class="btn-2" value="{$lang.save}" type="submit"/></span>&nbsp;&nbsp;
	  		<!-- {/if} -->
	  		<!-- {if $smarty.get.act=='view_sample'} -->
	    <span><input class="btn-2" value="{$lang.delete}" type="button" onclick="delete_sample()" /></span>&nbsp;&nbsp;
	        <!-- {/if} -->
	  	<!-- {else} -->
	  	<span><input class="btn-2" value="{$lang.save}" type="submit"/></span>&nbsp;&nbsp;
        <!-- {/if} -->
	  	<span><input type="button"  class="btn-2" onClick="history.back();"  value="{$lang.back}"/></span>
	</div>
	</form>
  </div>
</div>
<script language="javascript" type="text/javascript" src="{res file=js/tab_color.js}"></script>
<script type="text/javascript">
//客户评语
var customer_reviews = document.getElementById("customer_reviews");
autoTextarea(customer_reviews);// 调用 

//客户备注
var consumer_remark = document.getElementById("consumer_remark");
autoTextarea(consumer_remark);// 调用 
</script>
</body>
{$async_sendmail}
</html>